<template>
	<view class="topic">
		<view v-for="(item, i) in selectList" :key="i">
			<view class="title">{{item.name}}</view>

			<u-radio-group
				v-model="item.selectValue"
				placement="column"
				@change="groupChange"
				v-if="item.state == 'radio'"
			>
				<u-radio
					:customStyle="{marginBottom: '15px'}"
					v-for="(item, index) in item.radiolist1"
					:key="index"
					:label="item.name"
					:name="item.id"
				>
				</u-radio>
			</u-radio-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				selectList: [
					{
						// 单选基本案列数据
						name: '驾驶报废机动车上路行驶的驾驶人，除按规定罚款外，还要受到哪种处理?',
						radiolist1: [
							{
								name: 'A、撤销驾驶许可',
								id: 1,
							},
							{
								name: 'B、收缴驾驶证',
								id: 2
							},
							{
								name: 'C、强制恢复车况',
								id: 3
							},
							{
								name: 'D、吊销驾驶证',
								id: 44
							}
						],
						state: 'radio',		//判断是否是单选/多选 （radio单选，checkbox多选）
						selectValue: '',   
					},
				],
				newSelectList: [], // 新数组
			}
		},
		methods: {
			groupChange(n) {
        console.log('单选值', n);
				console.log(this.selectList, 111);
      },
		}
	}
</script>

<style lang="scss" scoped>
.topic {
	margin: 32rpx;
	.title {
		font-size: $uni-font-size-medium;
		margin-bottom: 40rpx;
	}
}
</style>
